<!doctype html>
<html>
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>基本信息查看</title>
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <script src="/static/js/common/common.js" type="text/javascript"></script>
    <link href="/webjars/miniui/css/demo.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/default.css" rel="stylesheet" type="text/css" />
    <style>
        .discell {
            text-align:right;
            width:20%;
        }
        .input {
            width:30%;
        }
    </style>
</head>
<body>
<form id="form1" method="post" style="height:100%;width: 100%;overflow-x: auto;overflow-y: auto;">
    <!-- 用户 编辑框START-->
    <div id="editform" class="form" style="padding:10px;">
        <input name="id" id="id" class="mini-hidden" style="width: 100%;" readonly />
        <input name="orgName" class="mini-hidden" style="width: 100%;" readonly />
        <input name="priNum" id="priNum" class="mini-hidden" style="width: 100%" readonly />
        <table class="form-table" align="center" style="width:85%" cellspacing="8">
            <tr>
                <td style="font-weight: bold;text-align: right"><span class="legend">基础信息</span></td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>姓&emsp;&emsp;名:</td>
                <td class="input">
                    <input name="pName" id="pName" class="mini-textbox" readonly="readonly" style="width: 80%; " required="true" />
                </td>
                <td class="discell">曾&nbsp;&nbsp;用&nbsp;&nbsp;名:</td>
                <td class="input">
                    <input name="usedName" id="usedName" class="mini-textbox" readonly="readonly" value="无" style="width: 80%;" /><font style="color: red;display: none" id="usedName1">被编辑</font>
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>性&emsp;&emsp;别:</td>
                <td class="input">
                    <input name="sex" id="sex" class="mini-combobox" readonly="readonly"
                           textField="codeName" valueField="codeId" style="width: 80%;"
                           url="/azbj/inmates/baseinfo/getTbsysCode?codeType=2_2&pcodeId=-1&sn=1" required="true" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>民&emsp;&emsp;族:</td>
                <td>
                    <input name="nationality" id="nationality" class="mini-combobox" required="true" readonly="readonly"
                           textField="codeName" valueField="codeId" emptyText="请选择..." style="width: 80%;"
                           url="/azbj/shzzgl/socialOrgInfo/getComboboxData?codeType=2_4"
                    />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>证件类型:</td>
                <td>
                    <input name="idType" id="idType" class="mini-combobox" required="true" readonly="readonly"
                           textField="codeName" valueField="codeId" emptyText="请选择..." style="width: 80%;"
                           url="/azbj/inmates/baseinfo/getTbsysCode?codeType=2_13&pcodeId=-1&sn=1"
                    />
                </td>
                <td class="discell">身份证号:</td>
                <td>
                    <input name="idNum" id="idNum" class="mini-textbox" readonly="readonly"
                           onvaluechanged="onMouseOut()" style="width: 80%;" />
                </td>
            </tr>
            <tr>
                <td class="discell">出生日期:</td>
                <td class="input">
                    <input property="editor" class="mini-datepicker" id="age" name="age" style="width: 80%;" readonly="readonly" allowInput="true" />
                </td>
                <td class="discell"><font color="#dc143c">*</font>
                    <#if level=="05">
                        入矫日期:
                    <#else >
                        入监日期:
                    </#if>
                </td>
                <td class="input">
                    <input property="editor" class="mini-datepicker" id="addtime" name="addtime" required="true" readonly="readonly" allowInput="true"
                           style="width: 80%;" />
                </td>
            </tr>
            <tr>
                <td class="discell"><font color="#dc143c">*</font>文化程度:</td>
                <td>
                    <input name="education" id="education" class="mini-combobox" readonly="readonly"
                           textField="codeName" valueField="codeId" emptyText="请选择..." style="width: 80%;"
                           url="/azbj/inmates/baseinfo/getTbsysCode?codeType=2_5&pcodeId=0&sn=0" required="true"
                    />
                </td>
            </tr>
            <tr>
                <td colspan="4">
                </td>
            </tr>
            <tr>
                <td style="font-weight: bold;text-align: right"><span class="legend">户籍信息</span></td>
            </tr>
            <tr>
                <td style="font-weight: bold;text-align: center"></td>
                <td class="input" align="left">
                    <input name="hjType" id="hjType" class="mini-radiobuttonlist"
                           data="[{ id: ''+'01', name: '户籍完整人员' },{ id: ''+'02', name: '查不清户籍人员' }]"
                           textField="name" valueField="id" value="01" required="true" showNullItem="true"
                           onvaluechanged="hjTypeOnclick()" readonly />
                </td>
            </tr>
            <tr id="hjlx">
                <td class="discell"><font color="#dc143c">*</font>户籍类型:</td>
                <td colspan="3">
                    <input name="priAddr" id="priAddr" class="mini-radiobuttonlist"
                           data="[{ id: ''+'01', name: '农村户籍' },{ id: ''+'02', name: '城镇户籍' },{ id: ''+'04', name: '非大陆籍' }]"
                           textField="name" valueField="id" value="01" required="true" showNullItem="true"
                           onvaluechanged="hjOnclick()" readonly="readonly" />
                </td>
            </tr>
        </table>
    </div>

    <!-- 户籍信息-->
    <div id="wzhjry" class="form" style="padding:10px;">
        <table class="form-table" align="center" style="width:85%" cellspacing="8">
            <tr>
                <td style="width: 20%;text-align: right"><font color="#dc143c">*</font>
                    户籍地址:
                </td>
                <td colspan="3" style="width: 80%">
                    <input id="nativepro" name="nativepro" class="mini-combobox" required="true" emptyText="省份"
                           style="width:22%;" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="nativecity" name="nativecity" class="mini-combobox" required="true" emptyText="市"
                           style="width: 23%" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="nativecou" name="nativecou" class="mini-combobox" required="true" emptyText="县"
                           style="width: 23%" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="nativevill" name="nativevill" class="mini-combobox" required="true" emptyText="街道" style="width:23%"
                           readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right"></td>
                <td colspan="3" style="width: 80%">
                    <input class="mini-textbox" required="true" style="width: 92.5%" emptyText="详细地址" id="nativenum"
                           name="nativenum" readonly="readonly" /><font style="color: red;display: none" id="nativenum1">被编辑</font>
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right">
                    <#if "${localCode !''}"=='140000'>
                        日常居住地:
                    <#else>
                        居住地址:
                    </#if>
                </td>
                <td colspan="3" style="width: 80%">
                    <input id="placepro" name="placepro" class="mini-combobox" emptyText="省份" style="width:22%;"
                           textfield="codeName" valueField="codeId" readonly="readonly"/>
                    <input id="placecity" name="placecity" class="mini-combobox" emptyText="市" style="width: 23%"
                           textfield="codeName" valueField="codeId" readonly="readonly" />
                    <input id="placecou" name="placecou" class="mini-combobox" emptyText="县" style="width: 23%"
                           textfield="codeName" valueField="codeId" readonly="readonly" />
                    <input id="placevill" name="placevill" class="mini-combobox" emptyText="街道" style="width: 23%"
                           readonly="readonly"
                           textfield="codeName" valueField="codeId"/><font style="color: red;display: none" id="placepro1">被编辑</font>
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right"></td>
                <td colspan="3" style="width: 80%">
                    <input class="mini-textbox" style="width: 92.5%" emptyText="详细地址" id="placenum" name="placenum" readonly="readonly" /><font style="color: red;display: none" id="placenum1">被编辑</font>
                </td>
            </tr>
        </table>
    </div>


    <#--查不清户籍人员-->
    <div id="cbqhj" class="form" style="padding:10px;display: none">
        <table class="form-table" align="center" style="margin-left: 10%;margin-right: 10%" cellspacing="8">

            <tr>
                <td style="width: 20%;text-align: right">
                    户籍地址:
                </td>
                <td colspan="3" style="width: 80%">
                    户籍地址不明
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right">
                    <font color="#dc143c">*</font>原侦查机关所在地:
                </td>
                <td colspan="3" style="width: 80%">
                    <input id="investigatePro" name="investigatePro" class="mini-combobox" emptyText="省份" style="width:22%;"
                           textfield="codeName" valueField="codeId" required="true" readonly="readonly"/>
                    <input id="investigateCity" name="investigateCity" class="mini-combobox" emptyText="市" style="width: 23%"
                           textfield="codeName" valueField="codeId" required="true" readonly="readonly"/>
                    <input id="investigateCou" name="investigateCou" class="mini-combobox" emptyText="县" style="width: 23%"
                           textfield="codeName" valueField="codeId"
                           required="true" readonly="readonly"/>
                    <input id="investigateVill" name="investigateVill" class="mini-combobox" emptyText="街道" style="width: 23%"
                           required="true" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right"></td>
                <td colspan="3" style="width: 80%">
                    <input class="mini-textbox" style="width: 92.5%" emptyText="详细地址" id="investigateNum" name="investigateNum"
                           required="true" readonly="readonly" />
                </td>
            </tr>
        </table>
    </div>

    <div id="fdlj" class="form" style="padding:10px;display: none">
        <table class="form-table" align="center" style="margin-left: 10%;margin-right: 10%" cellspacing="8">
            <tr>
                <td style="width: 20%;text-align: right">
                    <font color="#dc143c">*</font>具体类型:
                </td>
                <td colspan="3" style="width: 80%;">
                    <input name="detailType" id="detailType" class="mini-combobox" value="${detailType!''}"
                           data="[{ id: 1, name: '外国籍' },{ id: 2, name: '无国籍' },{ id: 3, name: '香港' },{ id: 4, name: '澳门' },{ id: 5, name: '台湾' }]"
                           textField="name" valueField="id" value="1" required="true" showNullItem="false"
                           readonly />
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right">
                    逮捕机构:
                </td>
                <td colspan="3" style="width: 80%">
                    <input id="arrestpro" name="arrestpro" class="mini-combobox" required="true" emptyText="省份"
                           style="width:22%;" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="arrestcity" name="arrestcity" class="mini-combobox" required="true" emptyText="市"
                           style="width: 23%" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="arrestcou" name="arrestcou" class="mini-combobox" required="true" emptyText="县"
                           style="width: 23%" readonly="readonly"
                           textfield="codeName" valueField="codeId"/>
                    <input id="arrestvill" name="arrestvill" class="mini-combobox" emptyText="街道" style="width: 23%"
                           readonly="readonly"
                           textfield="codeName" valueField="codeId"required="true" />
                </td>
            </tr>
            <tr>
                <td style="width: 20%;text-align: right"></td>
                <td colspan="3" style="width: 80%">
                    <input class="mini-textbox" required="true" style="width: 92.5%" emptyText="详细地址" name="arrestnum"
                           id="arrestnum" readonly="readonly" />
                </td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">
    mini.parse();
    var form = new mini.Form("form1");
    var name = mini.get("pName").getValue();
    var id = mini.get("id");
    var priNum = mini.get("priNum");
    var idNum = mini.get("idNum");
    var nativepro = mini.get("nativepro");
    var nativecity = mini.get("nativecity");
    var nativecou = mini.get("nativecou");
    var nativevill = mini.get("nativevill");
    var nativenum = mini.get("nativenum");

    var placepro = mini.get("placepro");
    var placecity = mini.get("placecity");
    var placecou = mini.get("placecou");
    var placevill = mini.get("placevill");
    var placenum = mini.get("placenum");

    var arrestpro = mini.get("arrestpro");
    var arrestcity = mini.get("arrestcity");
    var arrestcou = mini.get("arrestcou");
    var arrestvill = mini.get("arrestvill");
    var arrestnum = mini.get("arrestnum");

    var investigatePro = mini.get("investigatePro");
    var investigateCity = mini.get("investigateCity");
    var investigateCou = mini.get("investigateCou");
    var investigateVill = mini.get("investigateVill");
    var investigateNum = mini.get("investigateNum");

    window.onload = function () {
        var data = parent.setChildValue();
        priNum.setValue(data.priNum);
        SetData(priNum.getValue());
        var placepro='${placepro !''}';
        var placecity='${placecity!''}';
        var placecou='${placecou !''}';
        var placevill='${placevill !''}';
        var usedName='${usedName !''}';
        var placenum='${placenum !''}';
        var nativenum='${nativenum !''}';
        if(placepro == "true" || placecity == "true" || placecou == "true" || placevill =="true"){
            document.getElementById("placepro1").style.display = "inline-block";
        }
        if(usedName == "true"){
            document.getElementById("usedName1").style.display = "inline-block";
        }
        if(placenum == "true"){
            document.getElementById("placenum1").style.display = "inline-block";
        }
        if(nativenum == "true"){
            document.getElementById("nativenum1").style.display = "inline-block";
        }
    }

    function SetData(data) {
        form.setEnabled(false);
        if (data) {
            mini.get("id").setEnabled(false);
        }
        // 根据ID去数据库中查询数据
        $.ajax({
            url: "/azbj/inmates/getbaseinfo?prinum=" + data,
            type: "post",
            dataType: "json",
            success: function (bsdata) {
                form.setData(bsdata);
                form.setChanged(false);

                nativepro.setData([{codeId: bsdata.nativepro, codeName: bsdata.nativeproName}]);
                nativecity.setData([{codeId: bsdata.nativecity, codeName: bsdata.nativecityName}]);
                nativecou.setData([{codeId: bsdata.nativecou, codeName: bsdata.nativecouName}]);
                nativevill.setData([{codeId: bsdata.nativevill, codeName: bsdata.nativevillName}]);

                placepro.setData([{codeId: bsdata.placepro, codeName: bsdata.placeproName}]);
                placecity.setData([{codeId: bsdata.placecity, codeName: bsdata.placecityName}]);
                placecou.setData([{codeId: bsdata.placecou, codeName: bsdata.placecouName}]);
                placevill.setData([{codeId: bsdata.placevill, codeName: bsdata.placevillName}]);

                arrestpro.setData([{codeId: bsdata.arrestpro, codeName: bsdata.arrestproName}]);
                arrestcity.setData([{codeId: bsdata.arrestcity, codeName: bsdata.arrestcityName}]);
                arrestcou.setData([{codeId: bsdata.arrestcou, codeName: bsdata.arrestcouName}]);
                arrestvill.setData([{codeId: bsdata.arrestvill, codeName: bsdata.arrestvillName}]);

                investigatePro.setData([{codeId: bsdata.investigatePro, codeName: bsdata.investigateProName}]);
                investigateCity.setData([{codeId: bsdata.investigateCity, codeName: bsdata.investigateCityName}]);
                investigateCou.setData([{codeId: bsdata.investigateCou, codeName: bsdata.investigateCouName}]);
                investigateVill.setData([{codeId: bsdata.investigateVill, codeName: bsdata.investigateVillName}]);
                if (bsdata.hjType == '02') {
                    hjTypeOnclick();
                } else {
                    var value = bsdata.priAddr;
                    if (value == "02") { // 城镇户籍
                        document.getElementById("wzhjry").style.display = "block";
                        document.getElementById("fdlj").style.display = "none";
                        document.getElementById("cbqhj").style.display = "none";
                    } else if (value == "03") {
                        // 户籍为监所
                        document.getElementById("wzhjry").style.display = "none";
                        document.getElementById("fdlj").style.display = "none";
                        document.getElementById("cbqhj").style.display = "none";
                    } else if (value == "04") {
                        document.getElementById("wzhjry").style.display = "none";
                        document.getElementById("fdlj").style.display = "block";
                        document.getElementById("cbqhj").style.display = "none";
                    } else {//农村户籍
                        document.getElementById("wzhjry").style.display = "block";
                        document.getElementById("fdlj").style.display = "none";
                        document.getElementById("cbqhj").style.display = "none";
                    }
                }
            }
        });
    }

    /**
     * 查不清户籍 与 户籍完整人员大类显示控制方法
     */
    function hjTypeOnclick() {
        var value = mini.get("hjType").getValue();
        if (value == "02") { //查不清户籍人员
            document.getElementById("wzhjry").style.display = "none";
            document.getElementById("fdlj").style.display = "none";
            document.getElementById("hjlx").style.display = "none";
            document.getElementById("cbqhj").style.display = "block";
        } else {
            document.getElementById("wzhjry").style.display = "block";
            document.getElementById("fdlj").style.display = "none";
            document.getElementById("cbqhj").style.display = "none";
            document.getElementById("hjlx").style.display = "";
        }
    }
</script>
</body>
</html>